#ifndef _RTC_H
#define _RTC_H

#define _RTC_TDIF	+1.0	/* FR = UTC+1.0 */

#include "sam.h"

typedef struct {
	uint16_t	year;	/* 1970..2106 */
	uint8_t		month;	/* 1..12 */
	uint8_t		mday;	/* 1..31 */
	uint8_t		hour;	/* 0..23 */
	uint8_t		min;	/* 0..59 */
	uint8_t		sec;	/* 0..59 */
	uint8_t		wday;	/* 0..6 (Sun..Sat) */
} RTCTIME;

int rtc_initialize (void);				/* Initialize RTC */
int rtc_gettime (RTCTIME* rtc);			/* Get time */
int rtc_settime (const RTCTIME* rtc);	/* Set time */

#endif
